package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.entity.FieldVo;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/8/23 0023
 **/
@Data
@ApiModel("编码字段对象")
public class CodeFieldVo extends FieldVo {
    @ApiModelProperty(value = "编码字段ID，新增时不必传，修改时必传")
    private Long id;

    @NotNull(message = "字段类别不能为空")
    @NumberPattern(regexp = "^(1|2)$", message = "字段类别不合法！")
    @ApiModelProperty(value = "字段类别 1：编码表字段，2：编码用户登记表字段", required = true, example = "2")
    private Integer category;

    @NotNull(message = "移动端显示选项不能为空")
    @ApiModelProperty(value = "是否移动端显示：false-否，true-是", required = true, example = "false")
    private Boolean mobileShow;

    @NotNull(message = "列表显示选项不能为空")
    @ApiModelProperty(value = "是否列表显示：false-否，true-是", required = true, example = "false")
    private Boolean listShow;

    @NotNull(message = "查询条件显示选项不能为空")
    @ApiModelProperty(value = "是否作为查询条件显示：false-否，true-是", required = true, example = "false")
    private Boolean listCondition;

    @Valid
    @ApiModelProperty(value = "单选/多选内容对象")
    private List<CodeFieldContentVo> contentVos;

    @ApiModelProperty(value = "删除的单选/多选内容对象ID集合")
    private List<Long> delContentVoIds;
}
